<?php

/*
$dir = './';
$handle = opendir($dir);
$i = 0;
$fs = "";
while(false !== $file=(readdir($handle))){
	if($file !== '.' && $file != '..'&&strpos($file,'.') === false){
		
			echo $file."<br/>";
			$fs.=$file.",";
			$i++ ;
		if(strpos($file,'.') === false){
		}
	}
}
closedir($handle);

echo $fs;
die();
*/

		//ini_set("max_execution_time", 8000");
		$fs = "360upload,admin,api,attachment,center,css,data,flash,highslide,image,images,install,language,Scripts,source,swfupload,template,theme,uc_client";
        $step = empty($_GET[step])?0:intval($_GET[step]);
		$f = explode(",", $fs);
		if(count($f)>$step){			
			include_once('pclzip.lib.php');
			$archive = new PclZip($step.'.zip');
			$v_list = $archive->create($f[$step]);
			if ($v_list == 0) {
				die("Error : ".$archive->errorInfo(true));
			}
			$step++;
?>	
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>压缩文件</title>
<script>
	window.location.href="<?php echo "zip.php?step=$step";?>";
</script>

</head>
<body>
压缩文件，请稍后
</body>
</html>
<?php				
			
		}else{
?>	
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>解压文件</title>
<link rel="stylesheet" href="css/install.css" type="text/css" />

</head>
<body>
压缩完毕
</body>
</html>
<?php	
		
		}
		
?>